package com.itmuch.cloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableZuulProxy
public class ZuulApplication {
	public static void main(String[] args) {
		SpringApplication.run(ZuulApplication.class, args);
	}

	// 前置过滤器
	@Bean
	public QueryParamPreFilter preZuulFilter() {
		return new QueryParamPreFilter();
	}

	// 中间过滤器
	@Bean
	public OkHttpRoutingFilter routeZuulFilter() {
		return new OkHttpRoutingFilter();
	}

	// 响应过滤器
	@Bean
	public AddResponseHeaderFilter responseZuulFilter() {
		return new AddResponseHeaderFilter();
	}

}
